package cn.crm.controller;

import cn.crm.pojo.Orders;
import cn.crm.service.BasDictService;
import cn.crm.service.OrdersService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/Orders")
public class OrdersController {
    @Autowired
    private OrdersService ordersService;
    @PostMapping("/Page")
    public Page<Orders> getPage(@RequestBody HashMap<String,String> map){
        System.out.println("map = " + map);
        Page page = new Page<>();
        page.setSize(Long.parseLong(map.get("size")));
        page.setCurrent(Long.parseLong(map.get("current")));
        return ordersService.getOrdersPageByCustNo(page,map.get("custNo"));
    }
}
